package com.yunxin.core.application.service;

import com.yunxin.common.result.PageResult;
import com.yunxin.core.application.command.order.OrderUserApplyAllocationMerchantPageCommand;
import com.yunxin.core.application.command.order.OrderUserApplyAllocationPageCommand;
import com.yunxin.core.application.command.order.OrderUserApplyPageCommand;
import com.yunxin.core.application.dto.order.*;
import jakarta.validation.constraints.NotBlank;

import java.util.List;
import java.util.Set;

/**
 * @author zero°
 * @since 2023-07-12
 */
public interface OrderQueryAdminService {


    /**
     * 根据产品id查询当日订单条数
     * @param productIds productIds
     * @return List<OrderCountDTO>
     */
    List<OrderCountDTO> listOrderCountByProductIds(Set<Long> productIds);

    /**
     * 分页查询订单列表-平台端
     * @param command command
     * @return PageResult<OrderUserApplyAllocationPageResponse>
     */
    PageResult<OrderUserApplyAllocationPageDTO> orderUserApplyAllocationPageQuery(OrderUserApplyAllocationPageCommand command);

    List<OrderUserApplyAllocationPageDTO> orderUserApplyAllocationPageQueryList(OrderUserApplyAllocationPageCommand command);

    /**
     * 分页查询订单列表-商家端
     * @param command command
     * @return PageResult<OrderUserApplyAllocationPageResponse>
     */
    PageResult<OrderUserApplyAllocationMerchantPageDTO> orderUserApplyAllocationPageQueryByDataRole(OrderUserApplyAllocationMerchantPageCommand command);
    /**
     * 未接通列表
     * @param command
     * @return
     */
    PageResult<OrderUserApplyAllocationMerchantPageDTO> findAllNoConnectList(OrderUserApplyAllocationMerchantPageCommand command);

    List<OrderUserApplyAllocationMerchantPageDTO> orderUserApplyAllocationPageQueryByDataRolelist(OrderUserApplyAllocationMerchantPageCommand command);
    /**
     * 查询用户申请订单详情
     * @param applyOrderNo applyOrderNo
     * @return OrderUserApplyDetailDTO
     */
    OrderUserApplyDetailDTO getOrderUserApplyDetail(@NotBlank(message = "申请订单号不能为空") String applyOrderNo);

    /**
     * 查询用户最新的用户申请订单详情
     * @param userCode userCode
     * @return OrderUserApplyDetailDTO
     */
    OrderUserApplyDetailDTO getLastOrderUserApplyDetail(@NotBlank(message = "用户code不能为空") String userCode);

    /**
     * 分页查询用户申请订单列表
     * @param command command
     * @return PageResult<OrderUserApplyPageResponse>
     */
    PageResult<OrderUserApplyPageDTO> orderUserApplyPageQuery(OrderUserApplyPageCommand command);

    List<OrderUserApplyPageDTO> orderUserApplyPageQueryList(OrderUserApplyPageCommand command);

    /**
     * 分页查询二次uv统计表
     * @param command
     * @return
     */
    PageResult<ChannelPromotionTwoUvStatisticsDto> twoUvOrderStatistics(OrderUserApplyAllocationPageCommand command);
}
